package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JsonUtil;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
public class Commodity extends BaseDomain{

    //商品名称
    private String name;

    //所需积分
    private BigDecimal integral;

    //封面
    private String coverUrl;

    //销量
    private Integer salesVolume;

    public String getJson(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("integral",integral);
        map.put("coverUrl",coverUrl);
        return JsonUtil.toJsonString(map);
    }
}